package com.ssm.admin.service.impl;

import com.ssm.admin.entity.dto.SaleOrderDto;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ssm.common.utils.PageUtils;
import com.ssm.common.utils.Query;

import com.ssm.admin.dao.SsmSalesorderDao;
import com.ssm.admin.entity.SsmSalesorderEntity;
import com.ssm.admin.service.SsmSalesorderService;

@Service("ssmSalesorderService")
public class SsmSalesorderServiceImpl extends ServiceImpl<SsmSalesorderDao, SsmSalesorderEntity> implements SsmSalesorderService {

    @Autowired
    private SsmSalesorderDao ssmSalesorderDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SsmSalesorderEntity> page = this.page(
                new Query<SsmSalesorderEntity>().getPage(params),
                new QueryWrapper<SsmSalesorderEntity>()
        );

        return new PageUtils(page);
    }


    @Override
    public List<SaleOrderDto> findOrderInfo() {
        return ssmSalesorderDao.findOrderInfo();
    }

    @Override
    public List<SaleOrderDto> findOrderByUsername(String username, Integer page, Integer limit) {
        return ssmSalesorderDao.findOrderByUsername(username, page, limit);
    }

    @Override
    public Integer findCount() {
        return ssmSalesorderDao.findCount();
    }



}